﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CNdotnet.Ezsocio.Core.Service;
using System.Runtime.Serialization;
using Microsoft.Practices.EnterpriseLibrary.Validation.Validators;

namespace CNdotnet.Ezsocio.BusinessObjects
{
    [DataContract]
    public class AccountContract : BusinessBase
    {
        #region Users Properties

        [DataMember]
        public int ID { get; set; }

        [DataMember]
        [RegexValidator(@"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*",
            MessageTemplate = "Email输入格式不正确")]
        public string Email { get; set; }

        [StringLengthValidator(8, 128, MessageTemplate = "密码长度最小为8位")]
        public string Password { get; set; }

        [StringLengthValidator(8, 128, MessageTemplate = "确认密码长度最小为8位")]
        [PropertyComparisonValidator("Password", ComparisonOperator.Equal,
            MessageTemplate = "两次输入密码不一致")]
        public string PassConfirm { get; set; }

        public string Salt { get; set; }

        public MembershipStatus Status { get; set; }

        [DataMember]
        public bool IsOnline { get; set; }

        public DateTime CreateDate { get; set; }

        public DateTime? VerifyDate { get; set; }

        public DateTime LastLoginDate { get; set; }

        #endregion 

        #region Profile Properties
        [DataMember]
        [StringLengthValidator(3, 50, MessageTemplate = "姓名长度最少为3个字符")]
        public string TrueName { get; set; }

        
        public string NickName { get; set; }

        public string Gender { get; set; }

        public DateTime? Birthday { get; set; }

        public string Hometown { get; set; }

        public string QQ { get; set; }

        public string MSN { get; set; }

        public string PhoneNumber { get; set; }

        public string Website { get; set; }

        [DataMember]
        public string LogoUrl { get; set; }

        [DataMember]
        public string StatusSetting { get;set ;}
        [DataMember]
        public DateTime? UpdateStatusTime { get; set; }

        #endregion

        #region Releation Properties

        #endregion   
    }
}
